﻿using HelloASPNET.TruyXuatDuLieu;
using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HelloASPNET.Admin
{
  public partial class SuaThanhVien : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      string username = Request.QueryString["user"];
      if (string.IsNullOrEmpty(username))
      {
        Response.Redirect("DanhSachThanhVien.aspx");
      }
      DataTable tbl = TienIchSQL.ChayLenhSelectDuLieu("SELECT * FROM NguoiDung WHERE [Username]=@Username",
                                                        "@Username", username);
      if (tbl.Rows.Count == 0)
        lblThongBao.Text = "Duong dan khong dung";
      else
      {
        txtHoTen.Text =(string) tbl.Rows[0]["HoTen"];
      }
    }
  }
}